//
//  HashTools.swift
//  Edaixi-iOS
//
//  Created by 刘树华 on 2017/12/1.
//  Copyright © 2017年 刘树华. All rights reserved.
//

import Foundation

protocol SHA {
    var MD5 : String? {get}
    var FileMD5 : String? {get}
    
}

extension String : SHA {
    
    var MD5: String?{
  
        return FileHash.md5HexDigest(self)
    }
    var FileMD5: String? {
       return FileHash.md5HashOfFile(atPath: self)
    }
}
